this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};this.BX.Landing.Ui=this.BX.Landing.Ui||{};this.BX.Landing.Ui.Panel=this.BX.Landing.Ui.Panel||{};this.BX.Landing.Ui.Panel.Formsettingspanel=this.BX.Landing.Ui.Panel.Formsettingspanel||{};(function(e,t,s,n,i,a,r,l,o,c){"use strict";var d="/bitrix/js/landing/ui/panel/formsettingspanel/content/pay-systems/dist/images/message-icon.svg";var p,u;function b(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function m(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?b(Object(s),!0).forEach((function(t){babelHelpers.defineProperty(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):b(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}function h(e,t){g(e,t);t.add(e)}function y(e,t,s){g(e,t);t.set(e,s)}function g(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function v(e,t,s){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return s}var S=new WeakMap;var f=new WeakMap;var P=new WeakSet;var L=new WeakSet;var O=new WeakSet;var H=new WeakSet;var I=new WeakSet;var T=function(e){babelHelpers.inherits(t,e);function t(e){var s;babelHelpers.classCallCheck(this,t);s=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,e));h(babelHelpers.assertThisInitialized(s),I);h(babelHelpers.assertThisInitialized(s),H);h(babelHelpers.assertThisInitialized(s),O);h(babelHelpers.assertThisInitialized(s),L);h(babelHelpers.assertThisInitialized(s),P);y(babelHelpers.assertThisInitialized(s),S,{writable:true,value:"MODULE_NOT_INCLUDED"});y(babelHelpers.assertThisInitialized(s),f,{writable:true,value:void 0});s.setEventNamespace("BX.Landing.UI.Panel.FormSettingsPanel.PaySystemContent");babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),f,new c.SchemeManager(babelHelpers.toConsumableArray(e.dictionary.document.schemes)));s.addItem(v(babelHelpers.assertThisInitialized(s),L,E).call(babelHelpers.assertThisInitialized(s)));s.addItem(v(babelHelpers.assertThisInitialized(s),O,F).call(babelHelpers.assertThisInitialized(s)));s.addItem(v(babelHelpers.assertThisInitialized(s),H,B).call(babelHelpers.assertThisInitialized(s)));return s}babelHelpers.createClass(t,[{key:"getLayout",value:function e(){return this.cache.remember("layout",(function(){return a.Tag.render(p||(p=babelHelpers.taggedTemplateLiteral(['<div class="landing-ui-content-pay-system"></div>'])))}))}},{key:"getErrorPlaceholderLayout",value:function e(t){var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";return this.cache.remember("errorTitle",(function(){return a.Tag.render(u||(u=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="ui-slider-no-access">\n\t\t\t\t<div class="ui-slider-no-access-inner">\n\t\t\t\t\t<div class="ui-slider-no-access-title">','</div>\n\t\t\t\t\t<div class="ui-slider-no-access-subtitle">','</div>\n\t\t\t\t\t<div class="ui-slider-no-access-img">\n\t\t\t\t\t\t<div class="ui-slider-no-access-img-inner"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t'])),t,s)}))}},{key:"getValue",value:function e(){var s=a.Text.toNumber(this.options.formOptions.document.scheme);var n=v(this,H,B).call(this).isOpened();if(!babelHelpers.classPrivateFieldGet(this,f).isInvoice(s)&&n){this.options.formOptions.document.scheme=babelHelpers.classPrivateFieldGet(this,f).getSpecularSchemeId(s)}return babelHelpers.get(babelHelpers.getPrototypeOf(t.prototype),"getValue",this).call(this)}},{key:"valueReducer",value:function e(t){var s=t.paySystemsSelector;var n=this.options.formOptions.payment;var i=this.options.formOptions.document;n.disabledSystems=s.disabledPaySystems;n.use=v(this,H,B).call(this).isOpened();if(i.payment){i.payment=m(m({},i.payment),n)}else{i.payment=n}return{document:i}}},{key:"onChange",value:function e(t){this.emit("onChange",{skipPrepare:true})}},{key:"onFetchPaySystemsError",value:function e(t){var s=t[0];if(s.code===babelHelpers.classPrivateFieldGet(this,S)){v(this,P,w).call(this,s.message)}else{v(this,P,w).call(this,"Network error")}}}]);return t}(i.ContentWrapper);function w(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";a.Dom.clean(this.getLayout());a.Dom.append(this.getErrorPlaceholderLayout(e,t),this.getLayout())}function E(){return new s.HeaderCard({title:t.Loc.getMessage("LANDING_FORM_PAY_SYSTEMS_TITLE")})}function F(){return new n.MessageCard({id:"paymentMessage",header:t.Loc.getMessage("LANDING_FORM_PAY_SYSTEMS_MESSAGE_HEADER"),description:t.Loc.getMessage("LANDING_FORM_PAY_SYSTEMS_MESSAGE_DESCRIPTION"),icon:d,restoreState:true})}function B(){var e=this;return this.cache.remember("paySystemsSelectorForm",(function(){return new o.FormSettingsForm({id:"paySystemsForm",title:t.Loc.getMessage("LANDING_FORM_PAY_SYSTEMS_GET_PAYMENT"),toggleable:true,opened:e.options.formOptions.payment.use,fields:[v(e,I,M).call(e)]})}))}function M(){var e=this;return this.cache.remember("paySystemSelectorField",(function(){return new l.PaySystemsSelectorField({id:"paySystemsSelector",selector:"paySystemsSelector",disabledPaySystems:babelHelpers.toConsumableArray(e.options.formOptions.payment.disabledSystems),onFetchPaySystemsError:function t(s){return e.onFetchPaySystemsError(s)},showMorePaySystemsBtn:true,morePaySystemsBtnSidePanelPath:e.options.dictionary.payment.moreSystemSliderPath})}))}e.default=T})(this.BX.Landing.Ui.Panel.Formsettingspanel.Content=this.BX.Landing.Ui.Panel.Formsettingspanel.Content||{},BX.Landing,BX.Landing.UI.Card,BX.Landing.UI.Card,BX.Landing.UI.Panel,BX,BX.Event,BX.Landing.Ui.Field,BX.Landing.UI.Form,BX.Landing.Ui.Panel.Formsettingspanel.Content.Crm);
//# sourceMappingURL=pay-systems.bundle.map.js